package cn.zlj.springcloud.sys.server.service.impl;

import cn.zlj.springcloud.sys.common.UserInfo;
import cn.zlj.springcloud.sys.server.dao.SysUserDao;
import cn.zlj.springcloud.sys.server.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description
 * @Author ljzhong
 * @Date 2020/4/6
 */
@Slf4j
@Service
public class SysUserServiceImpl implements SysUserService {

    @Resource
    private SysUserDao sysUserDao;

    @Override
    public UserInfo findByUsername(String username) {
        log.info("UserInfoServiceImpl.findByUsername()");
        UserInfo userInfo = new UserInfo();
        BeanUtils.copyProperties(sysUserDao.findByUserName(username), userInfo);
        return userInfo;
    }
}
